
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>风险管理平台</title>
<script type="text/javascript" src="<?php echo base_url();?>theme/default/js/jquery-1.7.2.min.js"></script>

<link href="<?php echo base_url();?>theme/default/css/login.css" rel="stylesheet" type="text/css" />

        <script language="javascript" type="text/javascript">

		if (window.top!=window.self){
			window.top.location.href='<?php site_url('admin/user/login');?>';
		}
		function posts()
		{
			var username = $.trim($('#username').val());
			var password = $.trim($('#password').val());
			var user_type = $.trim($('#user_type').val());
			if(username == ''){ alert('用户名不能为空'); return false; }
			if(password == ''){ alert('密码不能为空');   return false; }

			var validateCode_value = $.trim($('#validateCode_value').val());
			$.ajax({ 
				type:'post',//可选get   
				url:'<?php echo site_url('user/login_post');?>',//这里是接收数据的PHP程序   
				data:'username='+username+'&password='+password+'&type='+user_type+'&validateCode='+validateCode_value,//传给PHP的数据，多个参数用&连接   
				dataType:'json',//服务器返回的数据类型 可选XML ,Json jsonp script html text等   
				success:function(msg){
					if(msg.type)
					{ 
						alert(msg.data);
						window.location='<?php echo site_url('');?>/'+msg.url;
					}
					else
					{
						alert(msg.data);
					}
				},   
				error:function(){   
					alert('系统错误');
				}   
			})
			return false;
		}		
		function respuesta()
		{
			setTimeout("window.location='<?php echo site_url('frame/home');?>'", 0 * 1000);
		}
		function random(min,max){

			return Math.floor(min+Math.random()*(max-min));

		}
		function validateCodes()
		{
			$('#validateCode').attr("src","<?php echo site_url('api/validateCode?');?>"+random(0,99999999));
		}
		function validateCodes_tnf()
		{
			
			return return_tnf;
		}
		</script>
</head>

<body>
	<div id="login">
		<div id="login_header">
			<h1 class="login_logo">
				<img src="<?php echo base_url();?>theme/default/images/login_logo.gif" />
			</h1>
			<div class="login_headerContent">
				<div class="navList">
					<ul>
					</ul>
				</div>
				<h2 class="login_title"><img src="<?php echo base_url();?>theme/default/images/login_title.png" /></h2>
			</div>
		</div>
		<div id="login_content">
			<div class="loginForm">
				<form id="login" onSubmit="return posts()">
					<p>
						<label>用户名：</label>
						<input type="text" id="username" name="username" size="20" class="login_input" />
					</p>
					<p>
						<label>密码：</label>
						<input type="password" id="password" name="password" size="20" class="login_input" />
					</p>
					<p>
						<label>账户类型：</label>
						<span><select id='user_type' name="type">
							  <option value ="1">ROOT</option>
							  <option value ="2">二级学院</option>
							  <option value="3">班主任</option>
							  <option value="4">新生接待员</option>
							</select>
						</span>
					</p>
					<p>
						<label>验证码：</label>
						<input class="code" name="validateCode_value" id="validateCode_value" type="text" size="5"><img id="validateCode" onClick="validateCodes()" src="<?php echo site_url('api/validateCode?'.rand(00000000,99999999));?>" width="90" height="22"/>
						<span></span>
					</p>
					<div class="login_bar">
						<input class="sub" type="submit" value=" " />
					</div>
				</form>
			</div>
			<div class="login_banner"><img src="<?php echo base_url();?>theme/default/images/login_banner.jpg" /></div>
			<div class="login_main">
				
			</div>
		</div>
		<div id="login_footer">
			Copyright &copy; 2009 www.dwzjs.com Inc. All Rights Reserved.
		</div>
	</div>
</body>
</html>